<template>
	<el-tabs v-model="activeName" @tab-click="handleClick">
		<el-tab-pane label="全部用户" name="first">
			<div style="margin:2% 0;display: inline-block;">
				<span>渠道筛选：</span>
				<el-select v-model="platform" placeholder="请选择类型" style="width:150px;"
					@change="selectTrigger(platform)">
					<el-option v-for="item in platforms" :key="item.value" :label="item.label" :value="item.value">
					</el-option>
				</el-select>&nbsp;&nbsp;&nbsp;&nbsp;
				<span>手机号：</span>
				<el-input style="width: 150px;" @keydown.enter.native="select" clearable placeholder="请输入手机号"
					v-model="phone">
				</el-input>&nbsp;&nbsp;&nbsp;&nbsp;
				<span>昵称：</span>
				<el-input style="width: 150px;" @keydown.enter.native="select" clearable placeholder="请输入昵称"
					v-model="nickName">
				</el-input>
			</div>
			<div style="margin:2% 0;display: inline-block;">
				<span style="display: inline-block;text-align: right;">等级：</span>
				<el-select v-model="memberIds" placeholder="请输入选择等级" style="width:150px;"
					@change="selectTrigger(memberIds)">
					<el-option v-for="item in memberList" :key="item.memberId" :label="item.gradeText"
						:value="item.memberId">
					</el-option>
				</el-select>
			</div>
			<div style="display: inline-block;">
				<el-button style="margin-left:15px;" size="mini" type="primary" icon="document" @click="select">查询
				</el-button>
				<el-button style="margin-left:15px;" size="mini" type="primary" icon="document" @click="cleans">重置
				</el-button>
				<el-button style="margin-left:15px;" size="mini" type="success" icon="document" @click="derive1">导出Excel
				</el-button>
				<el-button style="margin:0 0 20px 20px;" :disabled="!isAuth('userList:tongbu')" size="mini"
					type="warning" icon="document" @click="tongbu()">一键同步等级
				</el-button>
			</div>
			<el-table v-loading="tableDataLoading" :data="tableData.content">
				<el-table-column fixed prop="id" label="编号" width="80">
				</el-table-column>
				<el-table-column fixed prop="nickName" label="昵称" width="120">
					<template slot-scope="scope">
						<span style="color: #f56c6c;">{{ scope.row.nickName ? scope.row.nickName : '未设置' }}</span>
					</template>
				</el-table-column>
				<el-table-column prop="phone" label="手机号" width="120">
					<template slot-scope="scope">
						<span style="color: #4f9dec;cursor: pointer;"
							@click="updates(scope.row)">{{ scope.row.phone ? scope.row.phone : '未绑定' }}</span>
					</template>
				</el-table-column>
				<el-table-column prop="createAt" label="创建时间" width="180">
				</el-table-column>
				<el-table-column prop="gender" label="性别" width="100">
					<template slot-scope="scope">
						<span v-if="scope.row.gender == 1">男</span>
						<span v-if="scope.row.gender == 2">女</span>
						<span v-if="!scope.row.gender">未知</span>
					</template>
				</el-table-column>
				<el-table-column prop="relationId" label="会员编号" width="100">
					<template slot-scope="scope">
						<span>{{ scope.row.isInvitation === 0 ? '未授权' : scope.row.relationId ? scope.row.relationId : '未绑定' }}</span>
					</template>
				</el-table-column>
				<el-table-column prop="invitation" label="邀请人" width="150">
					<template slot-scope="scope">
						<span style="color: #4f9dec;cursor: pointer;"
							@click="colonelClick(scope.row.invitation)">{{ scope.row.invitation ? scope.row.invitation : '未设置' }}</span>
					</template>
				</el-table-column>
				<el-table-column prop="invitationCode" label="邀请码" width="150">
				</el-table-column>
				<el-table-column prop="gradeIndex" label="等级" width="150">
					<template slot-scope="scope">
						<span v-if="scope.row.gradeIndex">{{scope.row.gradeIndex}}级</span>
						<span style="color: #4f9dec;cursor:pointer;" @click="userChange(scope.row)">修改</span>
						</td>
					</template>
				</el-table-column>
				<el-table-column prop="grade" label="佣金" width="150">
					<template slot-scope="scope">
						<span>{{scope.row.grade * 100}}%</span>
						<div>
							<el-input type="text" @keydown.enter.native="addition(scope.row)" v-model="scope.row.grade"
								clearable placeholder="例0.3" style="width: 120px;font-size:14px;">
								<i slot="suffix" class="el-input__icon el-icon-search" @click="addition(scope.row)"></i>
							</el-input>
						</div>
					</template>
				</el-table-column>
				<el-table-column prop="zhiRate" label="直属用户佣金比例" width="150">
					<template slot-scope="scope">
						<span>{{scope.row.zhiRate * 100}}%</span>
						<div>
							<el-input type="text" @keydown.enter.native="zhiition(scope.row)"
								v-model="scope.row.zhiRate" clearable placeholder="例0.3"
								style="width: 120px;font-size:14px;">
								<i slot="suffix" class="el-input__icon el-icon-search" @click="zhiition(scope.row)"></i>
							</el-input>
						</div>
					</template>
				</el-table-column>
				<el-table-column prop="feiRate" label="非直属用户佣金比例" width="150">
					<template slot-scope="scope">
						<span>{{scope.row.feiRate * 100}}%</span>
						<div>
							<el-input type="text" @keydown.enter.native="feiition(scope.row)"
								v-model="scope.row.feiRate" clearable placeholder="例0.3"
								style="width: 120px;font-size:14px;">
								<i slot="suffix" class="el-input__icon el-icon-search" @click="feiition(scope.row)"></i>
							</el-input>
						</div>
					</template>
				</el-table-column>
				<el-table-column prop="zhifubao" label="支付宝">
					<template slot-scope="scope">
						<span>{{ scope.row.zhifubaoName }}{{ scope.row.zhifubao ? scope.row.zhifubao : '未绑定' }}</span>
					</template>
				</el-table-column>
				<el-table-column prop="cardFront" label="收款二维码" width="150">
					<template slot-scope="scope">
						<div v-if="scope.row.wxImg == null || scope.row.wxImg == ''">
							暂无图片
						</div>
						<div v-if="scope.row.wxImg" style="display:flex;flex-wrap: wrap;">
							<el-popover placement="top-start" title="" trigger="hover">
								<img style="width: 50px; height: 50px" :src="scope.row.wxImg" alt="" slot="reference">
								<img style="width: 200px; height: 200px" :src="scope.row.wxImg" alt="">
							</el-popover>
						</div>
					</template>
				</el-table-column>
				<el-table-column prop="jifen" label="余额" width="120">
					<template slot-scope="scope">
						<span>{{ scope.row.jifen | numFilter }}</span>
					</template>
				</el-table-column>
				<el-table-column prop="orderJifen" label="积分">
					<template slot-scope="scope">
						<span>{{ scope.row.orderJifen | numFilter }}</span>
					</template>
				</el-table-column>
				<el-table-column prop="name" label="备注" width="150">
					<template slot-scope="scope">
						<span>{{ scope.row.name }}</span>
						<div>
							<el-input type="text" @keydown.enter.native="remark(scope.row)" v-model="scope.row.name"
								clearable placeholder="备注" style="width: 120px;font-size:14px;">
								<i slot="suffix" class="el-input__icon el-icon-search" @click="remark(scope.row)"></i>
							</el-input>
						</div>
					</template>
				</el-table-column>
				<el-table-column prop="pub_share_pre_fee_user_s" label="来源">
					<template slot-scope="scope">
						<span v-if="scope.row.platform == 'weixin' ">公众号</span>
						<span v-if="scope.row.platform == 'wap' ">网站</span>
						<span v-if="scope.row.platform == 'app' ">APP</span>
						<span v-if="scope.row.platform == 'mp' ">小程序</span>
						<span v-if="scope.row.platform == '' ">未知</span>
					</template>
				</el-table-column>
				<el-table-column fixed="right" prop="state " label="状态">
					<template slot-scope="scope">
						<el-switch v-model="scope.row.state" @change="change(scope.row.state,scope.row.id)"
							:active-value="openValue" :inactive-value="closeValue" active-color="#13ce66"
							inactive-color="#ff4949">
						</el-switch>
					</template>
				</el-table-column>
        <el-table-column fixed="right" prop="isTuan" label="是否团长">
          <template slot-scope="scope">
            <el-switch v-model="scope.row.isTuan" @change="changeIsTuan(scope.row.isTuan,scope.row.id)"
                       :active-value="1" :inactive-value="-1" active-color="#13ce66"
                       inactive-color="#ff4949">
            </el-switch>
          </template>
        </el-table-column>
        <el-table-column fixed="right" prop="isTopTuan" label="是否顶级团长">
          <template slot-scope="scope">
            <el-switch v-model="scope.row.isTopTuan" @change="changeIsTopTuan(scope.row.isTopTuan,scope.row.id)"
                       :active-value="1" :inactive-value="-1" active-color="#13ce66"
                       inactive-color="#ff4949">
            </el-switch>
          </template>
        </el-table-column>
				<el-table-column label="操作" fixed="right" width="120">
					<template slot-scope="scope">
						<el-button size="mini" type="primary" @click="updates(scope.row)">用户详情
						</el-button>
						<el-button v-if="scope.row.relationId !==null && scope.row.pdd !==null" size="mini"
							type="primary" @click="price(scope.row)">多多比价
						</el-button>
						<el-button :disabled="!isAuth('userList:delete')" size="mini" type="danger"
							@click="deleteuser(scope.row)">
							删除用户
						</el-button>
						<el-button size="mini" type="primary" @click="chatBtn(scope.row)">联系用户
						</el-button>
					</template>
				</el-table-column>
			</el-table>
			<div style="text-align: center;margin-top: 10px;">
				<el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange"
					:page-sizes="[5, 10, 15, 20]" :page-size="size" :current-page="page"
					layout="total,sizes, prev, pager, next,jumper" :total="tableData.totalElements">
				</el-pagination>
			</div>
		</el-tab-pane>
		<el-tab-pane label="会员用户" name="second">
			<div style="margin:2% 0;display: inline-block;">
				<span>渠道筛选：</span>
				<el-select v-model="platform" placeholder="请选择类型" style="width:150px;"
					@change="selectTrigger(platform)">
					<el-option v-for="item in platforms" :key="item.value" :label="item.label" :value="item.value">
					</el-option>
				</el-select>&nbsp;&nbsp;&nbsp;&nbsp;
				<span>手机号：</span>
				<el-input style="width: 150px;" @keydown.enter.native="select" clearable placeholder="请输入手机号"
					v-model="phone">
				</el-input>&nbsp;&nbsp;&nbsp;&nbsp;
				<span>昵称：</span>
				<el-input style="width: 150px;" @keydown.enter.native="select" clearable placeholder="请输入昵称"
					v-model="nickName">
				</el-input>
			</div>
			<div style="margin:2% 0;display: inline-block;">
				<span style="display: inline-block;text-align: right;">等级：</span>
				<el-select v-model="memberIds" placeholder="请输入选择等级" style="width:150px;"
					@change="selectTrigger(memberIds)">
					<el-option v-for="item in memberList" :key="item.memberId" :label="item.gradeText"
						:value="item.memberId">
					</el-option>
				</el-select>
			</div>
			<div style="display: inline-block;">
				<el-button style="margin-left:15px;" size="mini" type="primary" icon="document" @click="select">查询
				</el-button>
				<el-button style="margin-left:15px;" size="mini" type="primary" icon="document" @click="cleans1">重置
				</el-button>
				<el-button style="margin-left:15px;" size="mini" type="success" icon="document" @click="derive2">导出Excel
				</el-button>
			</div>
			<el-table v-loading="tableDataLoading" :data="tableData.content">
				<el-table-column fixed prop="nickName" label="昵称" width="120">
					<template slot-scope="scope">
						<span style="color: #f56c6c;">{{ scope.row.nickName ? scope.row.nickName : '未设置' }}</span>
					</template>
				</el-table-column>
				<el-table-column prop="phone" label="手机号" width="120">
					<template slot-scope="scope">
						<span style="color: #4f9dec;cursor: pointer;"
							@click="updates(scope.row)">{{ scope.row.phone ? scope.row.phone : '未绑定' }}</span>
					</template>
				</el-table-column>
				<el-table-column prop="createAt" label="创建时间" width="180">
				</el-table-column>
				<el-table-column prop="gender" label="性别" width="100">
					<template slot-scope="scope">
						<span v-if="scope.row.gender == 1">男</span>
						<span v-if="scope.row.gender == 2">女</span>
						<span v-if="!scope.row.gender">未知</span>
					</template>
				</el-table-column>
				<el-table-column prop="relationId" label="会员编号" width="100">
					<template slot-scope="scope">
						<span>{{ scope.row.isInvitation === 0 ? '未授权' : scope.row.relationId ? scope.row.relationId : '未绑定' }}</span>
					</template>
				</el-table-column>
				<el-table-column prop="invitation" label="邀请人" width="150">
					<template slot-scope="scope">
						<span style="color: #4f9dec;cursor: pointer;"
							@click="colonelClick(scope.row.invitation)">{{ scope.row.invitation ? scope.row.invitation : '未设置' }}</span>
					</template>
				</el-table-column>
				<el-table-column prop="invitationCode" label="邀请码" width="150">
				</el-table-column>
				<el-table-column prop="gradeIndex" label="等级" width="150">
					<template slot-scope="scope">
						<span v-if="scope.row.gradeIndex">{{scope.row.gradeIndex}}级</span>
						<span style="color: #4f9dec;cursor:pointer;" @click="userChange(scope.row)">修改</span>
						</td>
					</template>
				</el-table-column>
				<el-table-column prop="grade" label="佣金" width="150">
					<template slot-scope="scope">
						<span>{{scope.row.grade * 100}}%</span>
						<div>
							<el-input type="text" @keydown.enter.native="addition(scope.row)" v-model="scope.row.grade"
								clearable placeholder="例0.3" style="width: 120px;font-size:14px;">
								<i slot="suffix" class="el-input__icon el-icon-search" @click="addition(scope.row)"></i>
							</el-input>
						</div>
					</template>
				</el-table-column>
				<el-table-column prop="zhiRate" label="直属用户佣金比例" width="150">
					<template slot-scope="scope">
						<span>{{scope.row.zhiRate * 100}}%</span>
						<div>
							<el-input type="text" @keydown.enter.native="zhiition(scope.row)"
								v-model="scope.row.zhiRate" clearable placeholder="例0.3"
								style="width: 120px;font-size:14px;">
								<i slot="suffix" class="el-input__icon el-icon-search" @click="zhiition(scope.row)"></i>
							</el-input>
						</div>
					</template>
				</el-table-column>
				<el-table-column prop="feiRate" label="非直属用户佣金比例" width="150">
					<template slot-scope="scope">
						<span>{{scope.row.feiRate * 100}}%</span>
						<div>
							<el-input type="text" @keydown.enter.native="feiition(scope.row)"
								v-model="scope.row.feiRate" clearable placeholder="例0.3"
								style="width: 120px;font-size:14px;">
								<i slot="suffix" class="el-input__icon el-icon-search" @click="feiition(scope.row)"></i>
							</el-input>
						</div>
					</template>
				</el-table-column>
				<el-table-column prop="zhifubao" label="支付宝">
					<template slot-scope="scope">
						<span>{{ scope.row.zhifubaoName }}{{ scope.row.zhifubao ? scope.row.zhifubao : '未绑定' }}</span>
					</template>
				</el-table-column>
				<el-table-column prop="cardFront" label="收款二维码" width="150">
					<template slot-scope="scope">
						<div v-if="scope.row.wxImg == null || scope.row.wxImg == ''">
							暂无图片
						</div>
						<div v-if="scope.row.wxImg" style="display:flex;flex-wrap: wrap;">
							<el-popover placement="top-start" title="" trigger="hover">
								<img style="width: 50px; height: 50px" :src="scope.row.wxImg" alt="" slot="reference">
								<img style="width: 200px; height: 200px" :src="scope.row.wxImg" alt="">
							</el-popover>
						</div>
					</template>
				</el-table-column>
				<el-table-column prop="jifen" label="余额" width="120">
					<template slot-scope="scope">
						<span>{{ scope.row.jifen | numFilter }}</span>
					</template>
				</el-table-column>
				<el-table-column prop="orderJifen" label="积分">
					<template slot-scope="scope">
						<span>{{ scope.row.orderJifen | numFilter }}</span>
					</template>
				</el-table-column>
				<el-table-column prop="name" label="备注" width="150">
					<template slot-scope="scope">
						<span>{{ scope.row.name }}</span>
						<div>
							<el-input type="text" @keydown.enter.native="remark(scope.row)" v-model="scope.row.name"
								clearable placeholder="备注" style="width: 120px;font-size:14px;">
								<i slot="suffix" class="el-input__icon el-icon-search" @click="remark(scope.row)"></i>
							</el-input>
						</div>
					</template>
				</el-table-column>
				<el-table-column prop="pub_share_pre_fee_user_s" label="来源">
					<template slot-scope="scope">
						<span v-if="scope.row.platform == 'weixin' ">公众号</span>
						<span v-if="scope.row.platform == 'wap' ">网站</span>
						<span v-if="scope.row.platform == 'app' ">APP</span>
						<span v-if="scope.row.platform == 'mp' ">小程序</span>
						<span v-if="scope.row.platform == '' "></span>
					</template>
				</el-table-column>
				<el-table-column fixed="right" prop="state " label="状态">
					<template slot-scope="scope">
						<el-switch v-model="scope.row.state" @change="change(scope.row.state,scope.row.id)"
							:active-value="openValue" :inactive-value="closeValue" active-color="#13ce66"
							inactive-color="#ff4949">
						</el-switch>
					</template>
				</el-table-column>
				<el-table-column fixed="right" label="操作" width="120">
					<template slot-scope="scope">
						<el-button size="mini" type="primary" @click="updates(scope.row)">用户详情
						</el-button>
						<el-button size="mini" type="primary" @click="hyorder(scope.row)">会员订单
						</el-button>
						<el-button size="mini" type="primary" @click="record(scope.row)">提现记录
						</el-button>
						<el-button v-if="scope.row.relationId !==null && scope.row.pdd !==null" size="mini"
							type="primary" @click="price(scope.row)">多多比价
						</el-button>
						<el-button size="mini" type="danger" :disabled="!isAuth('userList:delete')"
							@click="deleteuser(scope.row)">
							删除用户
						</el-button>
						<el-button size="mini" type="primary" @click="chatBtn(scope.row)">联系用户
						</el-button>
					</template>
				</el-table-column>
			</el-table>
			<div style="text-align: center;margin-top: 10px;">
				<el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange"
					:page-sizes="[5, 10, 15, 20]" :page-size="size" :current-page="page"
					layout="total,sizes, prev, pager, next,jumper" :total="tableData.totalElements">
				</el-pagination>
			</div>
		</el-tab-pane>
		<el-tab-pane label="普通用户" name="third">
			<div style="margin:2% 0;display: inline-block;">
				<span>渠道筛选：</span>
				<el-select v-model="platform" placeholder="请选择类型" style="width:150px;"
					@change="selectTrigger(platform)">
					<el-option v-for="item in platforms" :key="item.value" :label="item.label" :value="item.value">
					</el-option>
				</el-select>&nbsp;&nbsp;&nbsp;&nbsp;
				<span>手机号：</span>
				<el-input style="width: 150px;" @keydown.enter.native="select" clearable placeholder="请输入手机号"
					v-model="phone">
				</el-input>&nbsp;&nbsp;&nbsp;&nbsp;
				<span>昵称：</span>
				<el-input style="width: 150px;" @keydown.enter.native="select" clearable placeholder="请输入昵称"
					v-model="nickName">
				</el-input>
			</div>
			<div style="margin:2% 0;display: inline-block;">
				<span style="display: inline-block;text-align: right;">等级：</span>
				<el-select v-model="memberIds" placeholder="请输入选择等级" style="width:150px;"
					@change="selectTrigger(memberIds)">
					<el-option v-for="item in memberList" :key="item.memberId" :label="item.gradeText"
						:value="item.memberId">
					</el-option>
				</el-select>
			</div>
			<div style="display: inline-block;">
				<el-button style="margin-left:15px;" size="mini" type="primary" icon="document" @click="select">查询
				</el-button>
				<el-button style="margin-left:15px;" size="mini" type="primary" icon="document" @click="cleans4">重置
				</el-button>
				<el-button style="margin-left:15px;" size="mini" type="success" icon="document" @click="derive3">导出Excel
				</el-button>
			</div>
			<el-table v-loading="tableDataLoading" :data="tableData.content">
				<el-table-column fixed prop="nickName" label="昵称" width="120">
					<template slot-scope="scope">
						<span style="color: #f56c6c;">{{ scope.row.nickName ? scope.row.nickName : '未设置' }}</span>
					</template>
				</el-table-column>
				<el-table-column prop="phone" label="手机号" width="120">
					<template slot-scope="scope">
						<span style="color: #4f9dec;cursor: pointer;"
							@click="updates(scope.row)">{{ scope.row.phone ? scope.row.phone : '未绑定' }}</span>
					</template>
				</el-table-column>
				<el-table-column prop="createAt" label="创建时间" width="180">
				</el-table-column>
				<el-table-column prop="gender" label="性别" width="100">
					<template slot-scope="scope">
						<span v-if="scope.row.gender == 1">男</span>
						<span v-if="scope.row.gender == 2">女</span>
						<span v-if="!scope.row.gender">未知</span>
					</template>
				</el-table-column>
				<el-table-column prop="relationId" label="会员编号" width="100">
					<template slot-scope="scope">
						<span>{{ scope.row.isInvitation === 0 ? '未授权' : scope.row.relationId ? scope.row.relationId : '未绑定' }}</span>
					</template>
				</el-table-column>
				<el-table-column prop="invitation" label="邀请人" width="150">
					<template slot-scope="scope">
						<span style="color: #4f9dec;cursor: pointer;"
							@click="colonelClick(scope.row.invitation)">{{ scope.row.invitation ? scope.row.invitation : '未设置' }}</span>
					</template>
				</el-table-column>
				<el-table-column prop="invitationCode" label="邀请码" width="150">
				</el-table-column>
				<el-table-column prop="gradeIndex" label="等级" width="150">
					<template slot-scope="scope">
						<span v-if="scope.row.gradeIndex">{{scope.row.gradeIndex}}级</span>
						<span style="color: #4f9dec;cursor:pointer;" @click="userChange(scope.row)">修改</span>
						</td>
					</template>
				</el-table-column>
				<el-table-column prop="grade" label="佣金" width="150">
					<template slot-scope="scope">
						<span>{{scope.row.grade * 100}}%</span>
						<div>
							<el-input type="text" @keydown.enter.native="addition(scope.row)" v-model="scope.row.grade"
								clearable placeholder="例0.3" style="width: 120px;font-size:14px;">
								<i slot="suffix" class="el-input__icon el-icon-search" @click="addition(scope.row)"></i>
							</el-input>
						</div>
					</template>
				</el-table-column>
				<el-table-column prop="zhiRate" label="直属用户佣金比例" width="150">
					<template slot-scope="scope">
						<span>{{scope.row.zhiRate * 100}}%</span>
						<div>
							<el-input type="text" @keydown.enter.native="zhiition(scope.row)"
								v-model="scope.row.zhiRate" clearable placeholder="例0.3"
								style="width: 120px;font-size:14px;">
								<i slot="suffix" class="el-input__icon el-icon-search" @click="zhiition(scope.row)"></i>
							</el-input>
						</div>
					</template>
				</el-table-column>
				<el-table-column prop="feiRate" label="非直属用户佣金比例" width="150">
					<template slot-scope="scope">
						<span>{{scope.row.feiRate * 100}}%</span>
						<div>
							<el-input type="text" @keydown.enter.native="feiition(scope.row)"
								v-model="scope.row.feiRate" clearable placeholder="例0.3"
								style="width: 120px;font-size:14px;">
								<i slot="suffix" class="el-input__icon el-icon-search" @click="feiition(scope.row)"></i>
							</el-input>
						</div>
					</template>
				</el-table-column>
				<el-table-column prop="zhifubao" label="支付宝">
					<template slot-scope="scope">
						<span>{{ scope.row.zhifubaoName }}{{ scope.row.zhifubao ? scope.row.zhifubao : '未绑定' }}</span>
					</template>
				</el-table-column>
				<el-table-column prop="cardFront" label="收款二维码" width="150">
					<template slot-scope="scope">
						<div v-if="scope.row.wxImg == null || scope.row.wxImg == ''">
							暂无图片
						</div>
						<div v-if="scope.row.wxImg" style="display:flex;flex-wrap: wrap;">
							<el-popover placement="top-start" title="" trigger="hover">
								<img style="width: 50px; height: 50px" :src="scope.row.wxImg" alt="" slot="reference">
								<img style="width: 200px; height: 200px" :src="scope.row.wxImg" alt="">
							</el-popover>
						</div>
					</template>
				</el-table-column>
				<el-table-column prop="jifen" label="余额" width="120">
					<template slot-scope="scope">
						<span>{{ scope.row.jifen | numFilter }}</span>
					</template>
				</el-table-column>
				<el-table-column prop="orderJifen" label="积分">
					<template slot-scope="scope">
						<span>{{ scope.row.orderJifen | numFilter }}</span>
					</template>
				</el-table-column>
				<el-table-column prop="name" label="备注" width="150">
					<template slot-scope="scope">
						<span>{{ scope.row.name }}</span>
						<div>
							<el-input type="text" @keydown.enter.native="remark(scope.row)" v-model="scope.row.name"
								clearable placeholder="备注" style="width: 120px;font-size:14px;">
								<i slot="suffix" class="el-input__icon el-icon-search" @click="remark(scope.row)"></i>
							</el-input>
						</div>
					</template>
				</el-table-column>
				<el-table-column prop="pub_share_pre_fee_user_s" label="来源">
					<template slot-scope="scope">
						<span v-if="scope.row.platform == 'weixin' ">公众号</span>
						<span v-if="scope.row.platform == 'wap' ">网站</span>
						<span v-if="scope.row.platform == 'app' ">APP</span>
						<span v-if="scope.row.platform == 'mp' ">小程序</span>
						<span v-if="scope.row.platform == '' "></span>
					</template>
				</el-table-column>
				<el-table-column fixed="right" prop="state " label="状态">
					<template slot-scope="scope">
						<el-switch v-model="scope.row.state" @change="change(scope.row.state,scope.row.id)"
							:active-value="openValue" :inactive-value="closeValue" active-color="#13ce66"
							inactive-color="#ff4949">
						</el-switch>
					</template>
				</el-table-column>
				<el-table-column label="操作" fixed="right" width="120">
					<template slot-scope="scope">
						<el-button size="mini" type="primary" @click="updates(scope.row)">用户详情
						</el-button>
						<el-button v-if="scope.row.relationId !==null && scope.row.pdd !==null" size="mini"
							type="primary" @click="price(scope.row)">多多比价
						</el-button>
						<el-button size="mini" type="danger" :disabled="!isAuth('userList:delete')"
							@click="deleteuser(scope.row)">
							删除用户
						</el-button>
						<el-button size="mini" type="primary" @click="chatBtn(scope.row)">联系用户
						</el-button>
					</template>
				</el-table-column>
			</el-table>
			<div style="text-align: center;margin-top: 10px;">
				<el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange"
					:page-sizes="[5, 10, 15, 20]" :page-size="size" :current-page="page"
					layout="total,sizes, prev, pager, next,jumper" :total="tableData.totalElements">
				</el-pagination>
			</div>
		</el-tab-pane>
		<el-tab-pane label="团长用户" name="fourth">
			<div style="margin:2% 0;display: inline-block;">
				<span>渠道筛选：</span>
				<el-select v-model="platform" placeholder="请选择类型" style="width:150px;"
					@change="selectTrigger(platform)">
					<el-option v-for="item in platforms" :key="item.value" :label="item.label" :value="item.value">
					</el-option>
				</el-select>&nbsp;&nbsp;&nbsp;&nbsp;
				<span>手机号：</span>
				<el-input style="width: 150px;" @keydown.enter.native="select" clearable placeholder="请输入手机号"
					v-model="phone">
				</el-input>&nbsp;&nbsp;&nbsp;&nbsp;
				<span>昵称：</span>
				<el-input style="width: 150px;" @keydown.enter.native="select" clearable placeholder="请输入昵称"
					v-model="nickName">
				</el-input>
			</div>
			<div style="margin:2% 0;display: inline-block;">
				<span style="display: inline-block;text-align: right;">等级：</span>
				<el-select v-model="memberIds" placeholder="请输入选择等级" style="width:150px;"
					@change="selectTrigger(memberIds)">
					<el-option v-for="item in memberList" :key="item.memberId" :label="item.gradeText"
						:value="item.memberId">
					</el-option>
				</el-select>
			</div>
			<div style="display: inline-block;">
				<el-button style="margin-left:15px;" size="mini" type="primary" icon="document" @click="select">查询
				</el-button>
				<el-button style="margin-left:15px;" size="mini" type="primary" icon="document" @click="cleans5">重置
				</el-button>
				<el-button style="margin-left:15px;" size="mini" type="success" icon="document" @click="derive4">导出Excel
				</el-button>
			</div>
			<el-table v-loading="tableDataLoading" :data="tableData.content">
				<el-table-column fixed prop="nickName" label="昵称" width="120">
					<template slot-scope="scope">
						<span style="color: #f56c6c;">{{ scope.row.nickName ? scope.row.nickName : '未设置' }}</span>
					</template>
				</el-table-column>
				<el-table-column prop="phone" label="手机号" width="120">
					<template slot-scope="scope">
						<span style="color: #4f9dec;cursor: pointer;"
							@click="updates(scope.row)">{{ scope.row.phone ? scope.row.phone : '未绑定' }}</span>
					</template>
				</el-table-column>
				<el-table-column prop="createAt" label="创建时间" width="180">
				</el-table-column>
				<el-table-column prop="gender" label="性别" width="100">
					<template slot-scope="scope">
						<span v-if="scope.row.gender == 1">男</span>
						<span v-if="scope.row.gender == 2">女</span>
						<span v-if="!scope.row.gender">未知</span>
					</template>
				</el-table-column>
				<el-table-column prop="relationId" label="会员编号" width="100">
					<template slot-scope="scope">
						<span>{{ scope.row.isInvitation === 0 ? '未授权' : scope.row.relationId ? scope.row.relationId : '未绑定' }}</span>
					</template>
				</el-table-column>
				<el-table-column prop="invitation" label="邀请人" width="150">
					<template slot-scope="scope">
						<span style="color: #4f9dec;cursor: pointer;"
							@click="colonelClick(scope.row.invitation)">{{ scope.row.invitation ? scope.row.invitation : '未设置' }}</span>
					</template>
				</el-table-column>
				<el-table-column prop="invitationCode" label="邀请码" width="150">
				</el-table-column>
				<el-table-column prop="gradeIndex" label="等级" width="150">
					<template slot-scope="scope">
						<span v-if="scope.row.gradeIndex">{{scope.row.gradeIndex}}级</span>
						<span style="color: #4f9dec;cursor:pointer;" @click="userChange(scope.row)">修改</span>
						</td>
					</template>
				</el-table-column>
				<el-table-column prop="grade" label="佣金" width="150">
					<template slot-scope="scope">
						<span>{{scope.row.grade * 100}}%</span>
						<div>
							<el-input type="text" @keydown.enter.native="addition(scope.row)" v-model="scope.row.grade"
								clearable placeholder="例0.3" style="width: 120px;font-size:14px;">
								<i slot="suffix" class="el-input__icon el-icon-search" @click="addition(scope.row)"></i>
							</el-input>
						</div>
					</template>
				</el-table-column>
				<el-table-column prop="zhiRate" label="直属用户佣金比例" width="150">
					<template slot-scope="scope">
						<span>{{scope.row.zhiRate * 100}}%</span>
						<div>
							<el-input type="text" @keydown.enter.native="zhiition(scope.row)"
								v-model="scope.row.zhiRate" clearable placeholder="例0.3"
								style="width: 120px;font-size:14px;">
								<i slot="suffix" class="el-input__icon el-icon-search" @click="zhiition(scope.row)"></i>
							</el-input>
						</div>
					</template>
				</el-table-column>
				<el-table-column prop="feiRate" label="非直属用户佣金比例" width="150">
					<template slot-scope="scope">
						<span>{{scope.row.feiRate * 100}}%</span>
						<div>
							<el-input type="text" @keydown.enter.native="feiition(scope.row)"
								v-model="scope.row.feiRate" clearable placeholder="例0.3"
								style="width: 120px;font-size:14px;">
								<i slot="suffix" class="el-input__icon el-icon-search" @click="feiition(scope.row)"></i>
							</el-input>
						</div>
					</template>
				</el-table-column>
				<el-table-column prop="zhifubao" label="支付宝">
					<template slot-scope="scope">
						<span>{{ scope.row.zhifubaoName }}{{ scope.row.zhifubao ? scope.row.zhifubao : '未绑定' }}</span>
					</template>
				</el-table-column>
				<el-table-column prop="cardFront" label="收款二维码" width="150">
					<template slot-scope="scope">
						<div v-if="scope.row.wxImg == null || scope.row.wxImg == ''">
							暂无图片
						</div>
						<div v-if="scope.row.wxImg" style="display:flex;flex-wrap: wrap;">
							<el-popover placement="top-start" title="" trigger="hover">
								<img style="width: 50px; height: 50px" :src="scope.row.wxImg" alt="" slot="reference">
								<img style="width: 200px; height: 200px" :src="scope.row.wxImg" alt="">
							</el-popover>
						</div>
					</template>
				</el-table-column>
				<el-table-column prop="jifen" label="余额" width="120">
					<template slot-scope="scope">
						<span>{{ scope.row.jifen | numFilter }}</span>
					</template>
				</el-table-column>
				<el-table-column prop="orderJifen" label="积分">
					<template slot-scope="scope">
						<span>{{ scope.row.orderJifen | numFilter }}</span>
					</template>
				</el-table-column>
				<el-table-column prop="name" label="备注" width="150">
					<template slot-scope="scope">
						<span>{{ scope.row.name }}</span>
						<div>
							<el-input type="text" @keydown.enter.native="remark(scope.row)" v-model="scope.row.name"
								clearable placeholder="备注" style="width: 120px;font-size:14px;">
								<i slot="suffix" class="el-input__icon el-icon-search" @click="remark(scope.row)"></i>
							</el-input>
						</div>
					</template>
				</el-table-column>
				<el-table-column prop="pub_share_pre_fee_user_s" label="来源">
					<template slot-scope="scope">
						<span v-if="scope.row.platform == 'weixin' ">公众号</span>
						<span v-if="scope.row.platform == 'wap' ">网站</span>
						<span v-if="scope.row.platform == 'app' ">APP</span>
						<span v-if="scope.row.platform == 'mp' ">小程序</span>
						<span v-if="scope.row.platform == '' "></span>
					</template>
				</el-table-column>
				<el-table-column fixed="right" prop="state " label="状态">
					<template slot-scope="scope">
						<el-switch v-model="scope.row.state" @change="change(scope.row.state,scope.row.id)"
							:active-value="openValue" :inactive-value="closeValue" active-color="#13ce66"
							inactive-color="#ff4949">
						</el-switch>
					</template>
				</el-table-column>
				<el-table-column label="操作" fixed="right" width="120">
					<template slot-scope="scope">
						<el-button size="mini" type="primary" @click="updates(scope.row)">用户详情
						</el-button>
						<el-button size="mini" type="primary" @click="hyorder(scope.row)">会员订单
						</el-button>
						<el-button size="mini" type="primary" @click="record(scope.row)">提现记录
						</el-button>
						<el-button size="mini" type="primary" @click="colonel(scope.row)">团长订单
						</el-button>
						<el-button v-if="scope.row.relationId !==null && scope.row.pdd !==null" size="mini"
							type="primary" @click="price(scope.row)">多多比价
						</el-button>
						<el-button size="mini" type="danger" :disabled="!isAuth('userList:delete')"
							@click="deleteuser(scope.row)">
							删除用户
						</el-button>
						<el-button size="mini" type="primary" @click="chatBtn(scope.row)">联系用户
						</el-button>
					</template>
				</el-table-column>
			</el-table>
			<div style="text-align: center;margin-top: 10px;">
				<el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange"
					:page-sizes="[5, 10, 15, 20]" :page-size="size" :current-page="page"
					layout="total,sizes, prev, pager, next,jumper" :total="tableData.totalElements">
				</el-pagination>
			</div>
		</el-tab-pane>
		<el-tab-pane label="订单用户" name="fifth">
			<div style="margin:2% 0;display: inline-block;">
				<span>渠道筛选：</span>
				<el-select v-model="platform" placeholder="请选择类型" style="width:150px;"
					@change="selectTrigger(platform)">
					<el-option v-for="item in platforms" :key="item.value" :label="item.label" :value="item.value">
					</el-option>
				</el-select>&nbsp;&nbsp;&nbsp;&nbsp;
				<span>手机号：</span>
				<el-input style="width: 150px;" @keydown.enter.native="select" clearable placeholder="请输入手机号"
					v-model="phone">
				</el-input>&nbsp;&nbsp;&nbsp;&nbsp;
				<span>昵称：</span>
				<el-input style="width: 150px;" @keydown.enter.native="select" clearable placeholder="请输入昵称"
					v-model="nickName">
				</el-input>
				<span>会员编号：</span>
				<el-input style="width: 150px;" @keydown.enter.native="select" clearable placeholder="会员编号筛选"
					v-model="relationId"></el-input>
			</div>
			<div style="margin:2% 0;display: inline-block;">
				<span style="display: inline-block;text-align: right;">等级：</span>
				<el-select v-model="memberIds" placeholder="请输入选择等级" style="width:150px;" @change="select2(memberIds)">
					<el-option v-for="item in memberList" :key="item.memberId" :label="item.gradeText"
						:value="item.memberId">
					</el-option>
				</el-select>
			</div>
			<div style="display: inline-block;">
				<el-button style="margin-left:15px;" size="mini" type="primary" icon="document" @click="select2">查询
				</el-button>
				<el-button style="margin-left:15px;" size="mini" type="primary" icon="document" @click="cleans2">重置
				</el-button>
				<el-button style="margin-left:15px;" size="mini" type="success" icon="document" @click="derive">导出Excel
				</el-button>
			</div>
			<el-table v-loading="tableDataLoading" :data="userData.content">
				<el-table-column fixed prop="nick_name" label="昵称" width="120">
					<template slot-scope="scope">
						<span style="color: #f56c6c;">{{ scope.row.nick_name ? scope.row.nick_name : '未设置' }}</span>
					</template>
				</el-table-column>
				<el-table-column prop="phone" label="手机号" width="120">
					<template slot-scope="scope">
						<span style="color: #4f9dec;cursor: pointer;"
							@click="updates(scope.row)">{{ scope.row.phone ? scope.row.phone : '未绑定' }}</span>
					</template>
				</el-table-column>
				<el-table-column prop="create_at" label="创建时间" width="180">
				</el-table-column>
				<el-table-column prop="num" label="下单数量">
				</el-table-column>
				<el-table-column prop="gender" label="性别" width="100">
					<template slot-scope="scope">
						<span v-if="scope.row.gender == 1">男</span>
						<span v-if="scope.row.gender == 2">女</span>
						<span v-if="!scope.row.gender">未知</span>
					</template>
				</el-table-column>
				<el-table-column prop="relationId" label="会员编号" width="100">
					<template slot-scope="scope">
						<span style="color: #4f9dec;cursor: pointer;"
							@click="updates(scope.row)">{{ scope.row.isInvitation === 0 ? '未授权' : scope.row.relation_id ? scope.row.relation_id : '未绑定' }}</span>
					</template>
				</el-table-column>
				<el-table-column prop="invitation" label="邀请人" width="150">
					<template slot-scope="scope">
						<span style="color: #4f9dec;cursor: pointer;"
							@click="colonelClick(scope.row.invitation)">{{ scope.row.invitation ? scope.row.invitation : '未设置' }}</span>
					</template>
				</el-table-column>
				<el-table-column prop="invitation_code" label="邀请码" width="150">
				</el-table-column>
				<el-table-column prop="gradeIndex" label="等级" width="150">
					<template slot-scope="scope">
						<span v-if="scope.row.gradeIndex">{{scope.row.gradeIndex}}级</span>
						<span style="color: #4f9dec;cursor:pointer;" @click="userChange(scope.row)">修改</span>
						</td>
					</template>
				</el-table-column>
				<el-table-column prop="grade" label="佣金" width="150">
					<template slot-scope="scope">
						<span>{{scope.row.grade * 100}}%</span>
						<div>
							<el-input type="text" @keydown.enter.native="addition(scope.row)" v-model="scope.row.grade"
								clearable placeholder="例0.3" style="width: 120px;font-size:14px;">
								<i slot="suffix" class="el-input__icon el-icon-search" @click="addition(scope.row)"></i>
							</el-input>
						</div>
					</template>
				</el-table-column>
				<el-table-column prop="zhiRate" label="直属用户佣金比例" width="150">
					<template slot-scope="scope">
						<span>{{scope.row.zhiRate * 100}}%</span>
						<div>
							<el-input type="text" @keydown.enter.native="zhiition(scope.row)"
								v-model="scope.row.zhiRate" clearable placeholder="例0.3"
								style="width: 120px;font-size:14px;">
								<i slot="suffix" class="el-input__icon el-icon-search" @click="zhiition(scope.row)"></i>
							</el-input>
						</div>
					</template>
				</el-table-column>
				<el-table-column prop="feiRate" label="非直属用户佣金比例" width="150">
					<template slot-scope="scope">
						<span>{{scope.row.feiRate * 100}}%</span>
						<div>
							<el-input type="text" @keydown.enter.native="feiition(scope.row)"
								v-model="scope.row.feiRate" clearable placeholder="例0.3"
								style="width: 120px;font-size:14px;">
								<i slot="suffix" class="el-input__icon el-icon-search" @click="feiition(scope.row)"></i>
							</el-input>
						</div>
					</template>
				</el-table-column>
				<el-table-column prop="zhifubao" label="支付宝">
					<template slot-scope="scope">
						<span>{{ scope.row.zhifubaoName }}{{ scope.row.zhifubao ? scope.row.zhifubao : '未绑定' }}</span>
					</template>
				</el-table-column>
				<el-table-column prop="cardFront" label="收款二维码" width="150">
					<template slot-scope="scope">
						<div v-if="scope.row.wxImg == null || scope.row.wxImg == ''">
							暂无图片
						</div>
						<div v-if="scope.row.wxImg" style="display:flex;flex-wrap: wrap;">
							<el-popover placement="top-start" title="" trigger="hover">
								<img style="width: 50px; height: 50px" :src="scope.row.wxImg" alt="" slot="reference">
								<img style="width: 200px; height: 200px" :src="scope.row.wxImg" alt="">
							</el-popover>
						</div>
					</template>
				</el-table-column>
				<el-table-column prop="jifen" label="余额" width="120">
					<template slot-scope="scope">
						<span>{{ scope.row.jifen | numFilter }}</span>
					</template>
				</el-table-column>
				<el-table-column prop="order_jifen" label="积分">
					<template slot-scope="scope">
						<span>{{ scope.row.order_jifen | numFilter }}</span>
					</template>
				</el-table-column>
				<el-table-column prop="name" label="备注" width="150">
					<template slot-scope="scope">
						<span>{{ scope.row.name }}</span>
						<div>
							<el-input type="text" @keydown.enter.native="remark(scope.row)" v-model="scope.row.name"
								clearable placeholder="备注" style="width: 120px;font-size:14px;">
								<i slot="suffix" class="el-input__icon el-icon-search" @click="remark(scope.row)"></i>
							</el-input>
						</div>
					</template>
				</el-table-column>
				<el-table-column prop="pub_share_pre_fee_user_s" label="来源">
					<template slot-scope="scope">
						<span v-if="scope.row.platform == 'weixin' ">公众号</span>
						<span v-if="scope.row.platform == 'wap' ">网站</span>
						<span v-if="scope.row.platform == 'app' ">APP</span>
						<span v-if="scope.row.platform == 'mp' ">小程序</span>
						<span v-if="scope.row.platform == '' "></span>
					</template>
				</el-table-column>
				<el-table-column fixed="right" prop="state " label="状态">
					<template slot-scope="scope">
						<el-switch v-model="scope.row.state" @change="change(scope.row.state,scope.row.id)"
							:active-value="openValue" :inactive-value="closeValue" active-color="#13ce66"
							inactive-color="#ff4949">
						</el-switch>
					</template>
				</el-table-column>
				<el-table-column label="操作" fixed="right" width="120">
					<template slot-scope="scope">
						<el-button size="mini" type="primary" @click="updates(scope.row)">用户详情
						</el-button>
						<el-button v-if="scope.row.relationId !==null && scope.row.pdd !==null" size="mini"
							type="primary" @click="price(scope.row)">多多比价
						</el-button>
						<el-button size="mini" type="danger" :disabled="!isAuth('userList:delete')"
							@click="deleteuser(scope.row)">
							删除用户
						</el-button>
						<el-button size="mini" type="primary" @click="chatBtn(scope.row)">联系用户
						</el-button>
					</template>
				</el-table-column>
			</el-table>
			<div style="text-align: center;margin-top: 10px;">
				<el-pagination @size-change="handleSizeChange1" @current-change="handleCurrentChange1"
					:page-sizes="[5, 10, 15, 20]" :page-size="size" :current-page="page"
					layout="total,sizes, prev, pager, next,jumper" :total="userData.totalElements">
				</el-pagination>
			</div>
		</el-tab-pane>
		<el-tab-pane label="零钱用户" name="loose">
			<div style="margin:2% 0;display: inline-block;">
				<span>手机号：</span>
				<el-input style="width: 150px;" @keydown.enter.native="select" clearable placeholder="请输入手机号"
					v-model="phone">
				</el-input>&nbsp;&nbsp;&nbsp;&nbsp;
			</div>
			<div style="margin:2% 0;display: inline-block;">
				<span style="display: inline-block;text-align: right;">等级：</span>
				<el-select v-model="memberIds" placeholder="请输入选择等级" style="width:150px;" @change="select3(memberIds)">
					<el-option v-for="item in memberList" :key="item.memberId" :label="item.gradeText"
						:value="item.memberId">
					</el-option>
				</el-select>
			</div>
			<div style="display: inline-block;">
				<el-button style="margin-left:15px;" size="mini" type="primary" icon="document" @click="select3">查询
				</el-button>
				<el-button style="margin-left:15px;" size="mini" type="primary" icon="document" @click="cleans3">重置
				</el-button>
			</div>
			<el-table v-loading="tableDataLoading" :data="looseData.content">
				<el-table-column fixed prop="nickName" label="昵称" width="120">
					<template slot-scope="scope">
						<span style="color: #f56c6c;">{{ scope.row.nickName ? scope.row.nickName : '未设置' }}</span>
					</template>
				</el-table-column>
				<el-table-column prop="phone" label="手机号" width="120">
					<template slot-scope="scope">
						<span style="color: #4f9dec;cursor: pointer;"
							@click="updates(scope.row)">{{ scope.row.phone ? scope.row.phone : '未绑定' }}</span>
					</template>
				</el-table-column>
				<el-table-column prop="createAt" label="创建时间" width="180">
				</el-table-column>
				<el-table-column prop="jifen" label="余额" width="120">
					<template slot-scope="scope">
						<span>{{ scope.row.jifen | numFilter }}</span>
					</template>
				</el-table-column>
				<el-table-column prop="relationId" label="会员编号" width="100">
					<template slot-scope="scope">
						<span>{{ scope.row.isInvitation === 0 ? '未授权' : scope.row.relationId ? scope.row.relationId : '未绑定' }}</span>
					</template>
				</el-table-column>
				<el-table-column prop="invitation" label="邀请人" width="150">
					<template slot-scope="scope">
						<span style="color: #4f9dec;cursor: pointer;"
							@click="colonelClick(scope.row.invitation)">{{ scope.row.invitation ? scope.row.invitation : '未设置' }}</span>
					</template>
				</el-table-column>
				<el-table-column prop="invitationCode" label="邀请码" width="150">
				</el-table-column>
				<el-table-column prop="gradeIndex" label="等级" width="150">
					<template slot-scope="scope">
						<span v-if="scope.row.gradeIndex">{{scope.row.gradeIndex}}级</span>
						<span style="color: #4f9dec;cursor:pointer;" @click="userChange(scope.row)">修改</span>
						</td>
					</template>
				</el-table-column>
				<el-table-column prop="grade" label="佣金" width="150">
					<template slot-scope="scope">
						<span>{{scope.row.grade * 100}}%</span>
						<div>
							<el-input type="text" @keydown.enter.native="addition(scope.row)" v-model="scope.row.grade"
								clearable placeholder="例0.3" style="width: 120px;font-size:14px;">
								<i slot="suffix" class="el-input__icon el-icon-search" @click="addition(scope.row)"></i>
							</el-input>
						</div>
					</template>
				</el-table-column>
				<el-table-column prop="zhiRate" label="直属用户佣金比例" width="150">
					<template slot-scope="scope">
						<span>{{scope.row.zhiRate * 100}}%</span>
						<div>
							<el-input type="text" @keydown.enter.native="zhiition(scope.row)"
								v-model="scope.row.zhiRate" clearable placeholder="例0.3"
								style="width: 120px;font-size:14px;">
								<i slot="suffix" class="el-input__icon el-icon-search" @click="zhiition(scope.row)"></i>
							</el-input>
						</div>
					</template>
				</el-table-column>
				<el-table-column prop="feiRate" label="非直属用户佣金比例" width="150">
					<template slot-scope="scope">
						<span>{{scope.row.feiRate * 100}}%</span>
						<div>
							<el-input type="text" @keydown.enter.native="feiition(scope.row)"
								v-model="scope.row.feiRate" clearable placeholder="例0.3"
								style="width: 120px;font-size:14px;">
								<i slot="suffix" class="el-input__icon el-icon-search" @click="feiition(scope.row)"></i>
							</el-input>
						</div>
					</template>
				</el-table-column>
				<el-table-column prop="zhifubao" label="支付宝">
					<template slot-scope="scope">
						<span>{{ scope.row.zhifubaoName }}{{ scope.row.zhifubao ? scope.row.zhifubao : '未绑定' }}</span>
					</template>
				</el-table-column>
				<el-table-column prop="cardFront" label="收款二维码" width="150">
					<template slot-scope="scope">
						<div v-if="scope.row.wxImg == null || scope.row.wxImg == ''">
							暂无图片
						</div>
						<div v-if="scope.row.wxImg" style="display:flex;flex-wrap: wrap;">
							<el-popover placement="top-start" title="" trigger="hover">
								<img style="width: 50px; height: 50px" :src="scope.row.wxImg" alt="" slot="reference">
								<img style="width: 200px; height: 200px" :src="scope.row.wxImg" alt="">
							</el-popover>
						</div>
					</template>
				</el-table-column>
				<el-table-column prop="gender" label="性别" width="100">
					<template slot-scope="scope">
						<span v-if="scope.row.gender == 1">男</span>
						<span v-if="scope.row.gender == 2">女</span>
						<span v-if="!scope.row.gender">未知</span>
					</template>
				</el-table-column>
				<el-table-column prop="orderJifen" label="积分">
					<template slot-scope="scope">
						<span>{{ scope.row.orderJifen | numFilter }}</span>
					</template>
				</el-table-column>
				<el-table-column prop="name" label="备注" width="150">
					<template slot-scope="scope">
						<span>{{ scope.row.name }}</span>
						<div>
							<el-input type="text" @keydown.enter.native="remark(scope.row)" v-model="scope.row.name"
								clearable placeholder="备注" style="width: 120px;font-size:14px;">
								<i slot="suffix" class="el-input__icon el-icon-search" @click="remark(scope.row)"></i>
							</el-input>
						</div>
					</template>
				</el-table-column>
				<el-table-column prop="pub_share_pre_fee_user_s" label="来源">
					<template slot-scope="scope">
						<span v-if="scope.row.platform == 'weixin' ">公众号</span>
						<span v-if="scope.row.platform == 'wap' ">网站</span>
						<span v-if="scope.row.platform == 'app' ">APP</span>
						<span v-if="scope.row.platform == 'mp' ">小程序</span>
						<span v-if="scope.row.platform == '' "></span>
					</template>
				</el-table-column>
				<el-table-column fixed="right" prop="state " label="状态">
					<template slot-scope="scope">
						<el-switch v-model="scope.row.state" @change="change(scope.row.state,scope.row.id)"
							:active-value="openValue" :inactive-value="closeValue" active-color="#13ce66"
							inactive-color="#ff4949">
						</el-switch>
					</template>
				</el-table-column>
				<el-table-column label="操作" fixed="right" width="120">
					<template slot-scope="scope">
						<el-button size="mini" type="primary" @click="updates(scope.row)">用户详情
						</el-button>
						<el-button size="mini" type="primary" @click="record(scope.row)">提现记录
						</el-button>
						<el-button v-if="scope.row.relationId !==null && scope.row.pdd !==null" size="mini"
							type="primary" @click="price(scope.row)">多多比价
						</el-button>
						<el-button size="mini" type="danger" :disabled="!isAuth('userList:delete')"
							@click="deleteuser(scope.row)">
							删除用户
						</el-button>
						<el-button size="mini" type="primary" @click="chatBtn(scope.row)">联系用户
						</el-button>
					</template>
				</el-table-column>
			</el-table>
			<div style="text-align: center;margin-top: 10px;">
				<el-pagination @size-change="handleSizeChange2" @current-change="handleCurrentChange2"
					:page-sizes="[5, 10, 15, 20]" :page-size="size" :current-page="page"
					layout="total,sizes, prev, pager, next,jumper" :total="looseData.totalElements">
				</el-pagination>
			</div>
		</el-tab-pane>
		<el-tab-pane label="积分用户" name="integral">
			<div style="margin:2% 0;display: inline-block;">
				<span>手机号：</span>
				<el-input style="width: 150px;" @keydown.enter.native="select" clearable placeholder="请输入手机号"
					v-model="phone">
				</el-input>&nbsp;&nbsp;&nbsp;&nbsp;
			</div>
			<div style="margin:2% 0;display: inline-block;">
				<span style="display: inline-block;text-align: right;">等级：</span>
				<el-select v-model="memberIds" placeholder="请输入选择等级" style="width:150px;" @change="select3(memberIds)">
					<el-option v-for="item in memberList" :key="item.memberId" :label="item.gradeText"
						:value="item.memberId">
					</el-option>
				</el-select>
			</div>
			<div style="display: inline-block;">
				<el-button style="margin-left:15px;" size="mini" type="primary" icon="document" @click="select3">查询
				</el-button>
				<el-button style="margin-left:15px;" size="mini" type="primary" icon="document" @click="cleans3">重置
				</el-button>
			</div>
			<el-table v-loading="tableDataLoading" :data="looseData.content">
				<el-table-column fixed prop="nickName" label="昵称" width="120">
					<template slot-scope="scope">
						<span style="color: #f56c6c;">{{ scope.row.nickName ? scope.row.nickName : '未设置' }}</span>
					</template>
				</el-table-column>
				<el-table-column prop="phone" label="手机号" width="120">
					<template slot-scope="scope">
						<span style="color: #4f9dec;cursor: pointer;"
							@click="updates(scope.row)">{{ scope.row.phone ? scope.row.phone : '未绑定' }}</span>
					</template>
				</el-table-column>
				<el-table-column prop="createAt" label="创建时间" width="180">
				</el-table-column>
				<el-table-column prop="orderJifen" label="积分">
					<template slot-scope="scope">
						<span>{{ scope.row.orderJifen | numFilter }}</span>
					</template>
				</el-table-column>
				<el-table-column prop="relationId" label="会员编号" width="100">
					<template slot-scope="scope">
						<span>{{ scope.row.isInvitation === 0 ? '未授权' : scope.row.relationId ? scope.row.relationId : '未绑定' }}</span>
					</template>
				</el-table-column>
				<el-table-column prop="invitation" label="邀请人" width="150">
					<template slot-scope="scope">
						<span style="color: #4f9dec;cursor: pointer;"
							@click="colonelClick(scope.row.invitation)">{{ scope.row.invitation ? scope.row.invitation : '未设置' }}</span>
					</template>
				</el-table-column>
				<el-table-column prop="invitationCode" label="邀请码" width="150">
				</el-table-column>
				<el-table-column prop="gradeIndex" label="等级" width="150">
					<template slot-scope="scope">
						<span v-if="scope.row.gradeIndex">{{scope.row.gradeIndex}}级</span>
						<span style="color: #4f9dec;cursor:pointer;" @click="userChange(scope.row)">修改</span>
						</td>
					</template>
				</el-table-column>
				<el-table-column prop="grade" label="佣金" width="150">
					<template slot-scope="scope">
						<span>{{scope.row.grade * 100}}%</span>
						<div>
							<el-input type="text" @keydown.enter.native="addition(scope.row)" v-model="scope.row.grade"
								clearable placeholder="例0.3" style="width: 120px;font-size:14px;">
								<i slot="suffix" class="el-input__icon el-icon-search" @click="addition(scope.row)"></i>
							</el-input>
						</div>
					</template>
				</el-table-column>
				<el-table-column prop="zhiRate" label="直属用户佣金比例" width="150">
					<template slot-scope="scope">
						<span>{{scope.row.zhiRate * 100}}%</span>
						<div>
							<el-input type="text" @keydown.enter.native="zhiition(scope.row)"
								v-model="scope.row.zhiRate" clearable placeholder="例0.3"
								style="width: 120px;font-size:14px;">
								<i slot="suffix" class="el-input__icon el-icon-search" @click="zhiition(scope.row)"></i>
							</el-input>
						</div>
					</template>
				</el-table-column>
				<el-table-column prop="feiRate" label="非直属用户佣金比例" width="150">
					<template slot-scope="scope">
						<span>{{scope.row.feiRate * 100}}%</span>
						<div>
							<el-input type="text" @keydown.enter.native="feiition(scope.row)"
								v-model="scope.row.feiRate" clearable placeholder="例0.3"
								style="width: 120px;font-size:14px;">
								<i slot="suffix" class="el-input__icon el-icon-search" @click="feiition(scope.row)"></i>
							</el-input>
						</div>
					</template>
				</el-table-column>
				<el-table-column prop="zhifubao" label="支付宝">
					<template slot-scope="scope">
						<span>{{ scope.row.zhifubaoName }}{{ scope.row.zhifubao ? scope.row.zhifubao : '未绑定' }}</span>
					</template>
				</el-table-column>
				<el-table-column prop="cardFront" label="收款二维码" width="150">
					<template slot-scope="scope">
						<div v-if="scope.row.wxImg == null || scope.row.wxImg == ''">
							暂无图片
						</div>
						<div v-if="scope.row.wxImg" style="display:flex;flex-wrap: wrap;">
							<el-popover placement="top-start" title="" trigger="hover">
								<img style="width: 50px; height: 50px" :src="scope.row.wxImg" alt="" slot="reference">
								<img style="width: 200px; height: 200px" :src="scope.row.wxImg" alt="">
							</el-popover>
						</div>
					</template>
				</el-table-column>
				<el-table-column prop="jifen" label="余额" width="120">
					<template slot-scope="scope">
						<span>{{ scope.row.jifen | numFilter }}</span>
					</template>
				</el-table-column>
				<el-table-column prop="gender" label="性别" width="100">
					<template slot-scope="scope">
						<span v-if="scope.row.gender == 1">男</span>
						<span v-if="scope.row.gender == 2">女</span>
						<span v-if="!scope.row.gender">未知</span>
					</template>
				</el-table-column>
				<el-table-column prop="name" label="备注" width="150">
					<template slot-scope="scope">
						<span>{{ scope.row.name }}</span>
						<div>
							<el-input type="text" @keydown.enter.native="remark(scope.row)" v-model="scope.row.name"
								clearable placeholder="备注" style="width: 120px;font-size:14px;">
								<i slot="suffix" class="el-input__icon el-icon-search" @click="remark(scope.row)"></i>
							</el-input>
						</div>
					</template>
				</el-table-column>
				<el-table-column prop="pub_share_pre_fee_user_s" label="来源">
					<template slot-scope="scope">
						<span v-if="scope.row.platform == 'weixin' ">公众号</span>
						<span v-if="scope.row.platform == 'wap' ">网站</span>
						<span v-if="scope.row.platform == 'app' ">APP</span>
						<span v-if="scope.row.platform == 'mp' ">小程序</span>
						<span v-if="scope.row.platform == '' "></span>
					</template>
				</el-table-column>
				<el-table-column fixed="right" prop="state " label="状态">
					<template slot-scope="scope">
						<el-switch v-model="scope.row.state" @change="change(scope.row.state,scope.row.id)"
							:active-value="openValue" :inactive-value="closeValue" active-color="#13ce66"
							inactive-color="#ff4949">
						</el-switch>
					</template>
				</el-table-column>
				<el-table-column label="操作" fixed="right" width="120">
					<template slot-scope="scope">
						<el-button size="mini" type="primary" @click="updates(scope.row)">用户详情
						</el-button>
						<el-button size="mini" type="primary" @click="record(scope.row)">提现记录
						</el-button>
						<el-button v-if="scope.row.relationId !==null && scope.row.pdd !==null" size="mini"
							type="primary" @click="price(scope.row)">多多比价
						</el-button>
						<el-button size="mini" type="danger" :disabled="!isAuth('userList:delete')"
							@click="deleteuser(scope.row)">
							删除用户
						</el-button>
						<el-button size="mini" type="primary" @click="chatBtn(scope.row)">联系用户
						</el-button>
					</template>
				</el-table-column>
			</el-table>
			<div style="text-align: center;margin-top: 10px;">
				<el-pagination @size-change="handleSizeChange2" @current-change="handleCurrentChange2"
					:page-sizes="[5, 10, 15, 20]" :page-size="size" :current-page="page"
					layout="total,sizes, prev, pager, next,jumper" :total="looseData.totalElements">
				</el-pagination>
			</div>
		</el-tab-pane>
		<!-- 多多比价弹框 -->
		<el-dialog title="拼多多比价" :visible.sync="dialogFormVisible" center>
			<div style="margin-bottom: 10px;">
				<p style="word-wrap:break-word">{{ mobileUrl }}</p>
				<p>复制链接发送到微信打开授权即可</p>
			</div>
		</el-dialog>
		<!-- 修改等级 -->
		<el-dialog title="修改等级" :visible.sync="dialogFormVisibleDj" center>
			<div style="text-align: center;">
				<span style="display: inline-block;text-align: right;">等级：</span>
				<el-select v-model="memberId" placeholder="请输入选择等级" style="width:50%;">
					<el-option v-for="item in memberList" :key="item.grade" :label="item.gradeText"
						:value="item.memberId">
					</el-option>
				</el-select>
			</div>
			<div slot="footer" class="dialog-footer">
				<el-button @click="dialogFormVisibleDj = false">取 消</el-button>
				<el-button type="primary" @click="additionIndex()">确 定</el-button>
			</div>
		</el-dialog>
	</el-tabs>
</template>

<script>
	export default {
		data() {
			return {
				openValue: 'true',
				closeValue: 'false',
				state: 'false',
				size: 10,
				page: 1,
				phone: '',
				relationId: '',
				nickNam: '',
				platform: 'all',
				isRelation: -1,
				isTuan: -1,
				mobileUrl: '',
				nickName: '',
				grade: '',
				name: '',
				value: '',
				type: '',
				userData: [],
				activeName: 'first',
				dialogFormVisible: false,
				tableDataLoading: true,
				tableData: [],
				looseData: [],
				platforms: [{
					value: 'all',
					label: '全部'
				}, {
					value: 'wap',
					label: '网站'
				}, {
					value: 'app',
					label: 'APP'
				}, {
					value: 'weixin',
					label: '微信公众号'
				}, {
					value: 'mp',
					label: '微信小程序'
				}],
				startTime: '',
				endTime: '',
				info: {
					stockDate: this.getNowTime(), //日期
				},
				info2: {
					stockDate2: this.getNowTime2(), //日期
				},
				dialogFormVisibleDj: false,
				userId: '',
				memberId: '',
				memberList: [],
				memberIds: '',
			}
		},
		filters: {
			numFilter(value) {
				let realVal = ''
				if (!isNaN(value) && value !== '') {
					// 截取当前数据到小数点后两位
					realVal = parseFloat(value).toFixed(2)
				} else {
					realVal = '--'
				}
				return realVal
			}
		},
		methods: {
			//处理默认选中当前日期
			getNowTime() {
				var now = new Date()
				var year = now.getFullYear() //得到年份
				var month = now.getMonth() //得到月份
				var date = now.getDate() //得到日期
				month = month + 1
				month = month.toString().padStart(2, '0')
				date = date.toString().padStart(2, '0')
				var defaultDate = `${year}-${month}-${date}`
				return defaultDate
				this.$set(this.info, 'stockDate', defaultDate)
			},
			//处理默认选中当前日期
			getNowTime2() {
				var now = new Date()
				var year = now.getFullYear() //得到年份
				var month = now.getMonth() - now.getMonth() //得到月份
				var date = now.getDate() - now.getDate() + 1 //得到日期
				month = month + 1
				month = month.toString().padStart(2, '0')
				date = date.toString().padStart(2, '0')
				var defaultDate = `${year}-${month}-${date}`
				return defaultDate
				this.$set(this.info, 'stockDate', defaultDate)
			},
			// 导出Excel
			derive1() {
				this.isRelation = -1
				this.isTuan = -1
				this.deriveSelect()
			},
			derive2() {
				this.isRelation = 1
				this.isTuan = -1
				this.deriveSelect()
			},
			derive3() {
				this.isRelation = 0
				this.isTuan = -1
				this.deriveSelect()
			},
			derive4() {
				this.isRelation = -1
				this.isTuan = 1
				this.deriveSelect()
			},
			deriveSelect() {
				let phone = -1
				if (this.phone) {
					phone = this.phone
				}
				this.tableDataLoading = true
				this.$http({
					url: this.$http.adornUrl2('/user/userListExcel'),
					method: 'get',
					responseType: 'blob',
					params: this.$http.adornParams({
						'phone': phone,
						'platform': this.platform,
						'isRelation': this.isRelation,
						'isTuan': this.isTuan,
						'nickName': this.nickName,
					})
				}).then(({
					data
				}) => {
					this.tableDataLoading = false
					let blob = new Blob([data], {
						type: 'application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
					})
					if (window.navigator.msSaveOrOpenBlob) {
						navigator.msSaveBlob(blob)
					} else {
						let url = window.URL.createObjectURL(blob)
						let elink = document.createElement('a')
						elink.download = '用户信息报表.xlsx'
						elink.style.display = 'none'
						elink.href = url
						document.body.appendChild(elink)
						elink.click()
						document.body.removeChild(elink)
					}
				})
			},
			derive() {
				let phone = -1
				if (this.phone) {
					phone = this.phone
				}
				let nickName = -1
				if (this.nickName) {
					nickName = this.nickName
				}
				let relationId = -1
				if (this.relationId) {
					relationId = this.relationId
				}
				this.tableDataLoading = true
				this.$http({
					url: this.$http.adornUrl2(
						`/order/userOrderListExcel?phone=${phone}&nickName=${nickName}&relationId=${relationId}`
						),
					method: 'get',
					responseType: 'blob',
					params: this.$http.adornParams({})
				}).then(({
					data
				}) => {
					this.tableDataLoading = false
					let blob = new Blob([data], {
						type: 'application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
					})
					if (window.navigator.msSaveOrOpenBlob) {
						navigator.msSaveBlob(blob)
					} else {
						let url = window.URL.createObjectURL(blob)
						let elink = document.createElement('a')
						elink.download = '订单用户报表.xlsx'
						elink.style.display = 'none'
						elink.href = url
						document.body.appendChild(elink)
						elink.click()
						document.body.removeChild(elink)
					}
				})
			},
			// 多多比价
			price(row) {
				this.$http({
					url: this.$http.adornUrl2(`/pdd/bijia?userId=${row.id}`),
					method: 'get',
					params: this.$http.adornParams({})
				}).then(({
					data
				}) => {
					if (data.status == 0) {
						this.dialogFormVisible = true
						this.mobileUrl = data.data[0].mobileUrl
					}
					if (data.status == 9999) {
						this.$message({
							message: data.msg,
							type: 'error',
							duration: 3600,
							onClose: () => {
								this.dataSelect()
							}
						})
					}
					if (data.status == 500) {
						this.$message({
							message: data.msg,
							type: 'error',
							duration: 3600,
							onClose: () => {
								this.dataSelect()
							}
						})
					}
				})
			},
			// 团长跳转详情页
			colonelClick(relationId) {
				this.$http({
					url: this.$http.adornUrl2('/user/relationId'),
					method: 'get',
					params: this.$http.adornParams({
						'relationId': relationId,
					})
				}).then(({
					data
				}) => {
					let returnData = data.data
					let id = returnData.id
					if (this.value == 1) {
						this.$router.push({
							path: '/userDetail',
							query: {
								userId: id
							}
						})
					} else {
						this.$router.push({
							path: '/userDetailThree',
							query: {
								userId: id
							}
						})
					}
				})
			},
			// 修改等级
			addition(row) {
				let userId = row.id
				let grade = row.grade
				this.$confirm(`确定要修改等级吗?`, '提示', {
					confirmButtonText: '确定',
					cancelButtonText: '取消',
					type: 'warning'
				}).then(() => {
					this.$http({
						url: this.$http.adornUrl2('/user/updateGrades'),
						method: 'get',
						params: this.$http.adornParams({
							'userId': userId,
							'grade': grade
						})
					}).then(({
						data
					}) => {
						this.$message({
							message: '修改成功',
							type: 'success',
							duration: 1500,
							onClose: () => {
								this.dataSelect()
							}
						})
					})
				}).catch(() => {})
			},
			// 等级弹框
			userChange(row) {
				this.userId = row.id
				this.dialogFormVisibleDj = true
			},
			// 修改等级
			additionIndex(row) {
				// this.$confirm(`确定要修改用户等级吗?`, '提示', {
				// 	confirmButtonText: '确定',
				// 	cancelButtonText: '取消',
				// 	type: 'warning'
				// }).then(() => {
				this.$http({
					url: this.$http.adornUrl2('member/setUserMember'),
					method: 'post',
					params: this.$http.adornParams({
						'userId': this.userId,
						'memberId': this.memberId
					})
				}).then(({
					data
				}) => {
					if (data.status == 0) {
						this.$message({
							message: '修改成功',
							type: 'success',
							duration: 1500,
							onClose: () => {
								this.dialogFormVisibleDj = false
								this.dataSelect()
							}
						})
					} else {
						this.$message.error(data.msg)
					}

				})
				// }).catch(() => {})
			},
			// // 修改佣金
			// addition(row) {
			// 	let userId = row.id
			// 	let grade = row.grade
			// 	this.$confirm(`确定要修改佣金吗?`, '提示', {
			// 		confirmButtonText: '确定',
			// 		cancelButtonText: '取消',
			// 		type: 'warning'
			// 	}).then(() => {
			// 		this.$http({
			// 			url: this.$http.adornUrl2('/user/updateUser'),
			// 			method: 'post',
			// 			params: this.$http.adornParams({
			// 				'userId':userId,
			// 				'grade':row.grade
			// 			})
			// 		}).then(({
			// 			data
			// 		}) => {
			// 			if (data.status == 0) {
			// 				this.$message({
			// 					message: '修改成功',
			// 					type: 'success',
			// 					duration: 1500,
			// 					onClose: () => {
			// 						this.dataSelect()
			// 					}
			// 				})
			// 			} else {
			// 				this.$message.error(data.msg)
			// 			}

			// 		})
			// 	}).catch(() => {})
			// },
			// 修改直推粉丝佣金
			zhiition(row) {
				let userId = row.id
				let zhiRate = row.zhiRate
				this.$confirm(`确定要修改直属用户佣金比例吗?`, '提示', {
					confirmButtonText: '确定',
					cancelButtonText: '取消',
					type: 'warning'
				}).then(() => {

					this.$http({
						url: this.$http.adornUrl2('/user/updateUser'),
						method: 'post',
						params: this.$http.adornParams({
							'userId': userId,
							'zhiRate': zhiRate
						})
					}).then(({
						data
					}) => {
						if (data.status == 0) {
							this.$message({
								message: '修改成功',
								type: 'success',
								duration: 1500,
								onClose: () => {
									this.dataSelect()
								}
							})
						} else {
							this.$message.error(data.msg)
						}
					})
				}).catch(() => {})
			},
			// 修改非直属用户佣金
			feiition(row) {
				let userId = row.id
				let feiRate = row.feiRate
				this.$confirm(`确定要修改非直属用户佣金比例吗?`, '提示', {
					confirmButtonText: '确定',
					cancelButtonText: '取消',
					type: 'warning'
				}).then(() => {
					this.$http({
						url: this.$http.adornUrl2('/user/updateUser'),
						method: 'post',
						params: this.$http.adornParams({
							'userId': userId,
							'feiRate': feiRate
						})
					}).then(({
						data
					}) => {
						this.$message({
							message: '修改成功',
							type: 'success',
							duration: 1500,
							onClose: () => {
								this.dataSelect()
							}
						})
					})
				}).catch(() => {})
			},
			// 修改备注
			remark(row) {
				let userId = row.id
				let name = row.name
				this.$confirm(`确定要修改备注吗?`, '提示', {
					confirmButtonText: '确定',
					cancelButtonText: '取消',
					type: 'warning'
				}).then(() => {
					this.$http({
						url: this.$http.adornUrl2('/user/updateName'),
						method: 'get',
						params: this.$http.adornParams({
							'userId': userId,
							'name': name
						})
					}).then(({
						data
					}) => {
						this.$message({
							message: '修改成功',
							type: 'success',
							duration: 1500,
							onClose: () => {
								this.dataSelect()
							}
						})
					})
				}).catch(() => {})
			},
			// 状态
			change(val, id) {
				this.$http({
					url: this.$http.adornUrl2(`/user/updateState/${id}`),
					method: 'post',
					data: this.$http.adornData({})
				}).then(({
					data
				}) => {
					this.$message({
						message: '操作成功',
						type: 'success',
						duration: 1500,
						onClose: () => {
							this.dataSelect()
						}
					})
				})
			},
			changeIsTuan(val, id) {
				this.$http({
					url: this.$http.adornUrl2(`/user/updateIsTuan/${id}`),
					method: 'post',
					data: this.$http.adornData({})
				}).then(({
					data
				}) => {
					this.$message({
						message: '操作成功',
						type: 'success',
						duration: 1500,
						onClose: () => {
							this.dataSelect()
						}
					})
				})
			},
			changeIsTopTuan(val, id) {
				this.$http({
					url: this.$http.adornUrl2(`/user/updateIsTopTuan/${id}`),
					method: 'post',
					data: this.$http.adornData({})
				}).then(({
					data
				}) => {
					this.$message({
						message: '操作成功',
						type: 'success',
						duration: 1500,
						onClose: () => {
							this.dataSelect()
						}
					})
				})
			},
			// 会员订单跳转
			hyorder(row) {
				this.$router.push({
					path: '/order',
					query: {
						relationid: row.relationId
					}
				})
			},
			// 提现记录跳转
			record(row) {
				this.$router.push({
					path: '/financeList'
				})
			},
			// 团长订单跳转
			colonel(row) {
				this.$router.push({
					path: '/order',
					query: {
						invitation: row.invitation
					}
				})
			},
			// 详情跳转
			updates(row) {
				this.$http({
					url: this.$http.adornUrl2('/common/type/91'),
					method: 'get',
					params: this.$http.adornParams({})
				}).then(({
					data
				}) => {
					let returnData = data.data
					this.value = returnData.value
					if (this.value == 1) {
						this.$router.push({
							path: '/userDetail',
							query: {
								userId: row.id,
								activeName: this.activeName
							}
						})
					} else {
						this.$router.push({
							path: '/userDetailThree',
							query: {
								userId: row.id,
								activeName: this.activeName
							}
						})
					}
				})

			},
			handleSizeChange(val) {
				this.size = val
				this.dataSelect()
			},
			handleCurrentChange(val) {
				this.page = val
				this.dataSelect()
			},
			handleSizeChange1(val) {
				this.size = val
				this.userSelect()
			},
			handleCurrentChange1(val) {
				this.page = val
				this.userSelect()
			},
			handleSizeChange2(val) {
				this.size = val
				this.looseSelect()
			},
			handleCurrentChange2(val) {
				this.page = val
				this.looseSelect()
			},
			handleClick(tab, event) {
				if (tab._props.label == '全部用户') {
					this.page = 1
					this.size = 10
					this.isRelation = -1
					this.isTuan = -1
					this.dataSelect()
				}
				if (tab._props.label == '会员用户') {
					this.page = 1
					this.size = 10
					this.isRelation = 1
					this.isTuan = -1
					this.dataSelect()
				}
				if (tab._props.label == '普通用户') {
					this.page = 1
					this.size = 10
					this.isRelation = 0
					this.isTuan = -1
					this.dataSelect()
				}
				if (tab._props.label == '团长用户') {
					this.page = 1
					this.size = 10
					this.isRelation = -1
					this.isTuan = 1
					this.dataSelect()
				}
				if (tab._props.label == '订单用户') {
					this.page = 1
					this.size = 10
					this.activeName = tab._props.name
					this.userSelect()
				}
				if (tab._props.label == '零钱用户') {
					this.page = 1
					this.size = 10
					this.type = 2
					this.looseSelect()
				}
				if (tab._props.label == '积分用户') {
					this.page = 1
					this.size = 10
					this.type = 1
					this.activeName = tab._props.name
					this.looseSelect()
				}
			},
			// select自动选择
			selectTrigger() {
				this.page = 1
				this.dataSelect()
			},
			// 查询
			select() {
				this.page = 1
				this.dataSelect()
			},
			// 查询
			select2() {
				this.page = 1
				this.userSelect()
			},
			// 查询
			select3() {
				this.page = 1
				this.looseSelect()
			},
			// 重置
			cleans() {
				this.page = 1
				this.platform = 'all'
				this.phone = ''
				this.isTuan = -1
				this.isRelation = -1
				this.nickName = ''
				this.memberIds = ''
				this.dataSelect()
			},
			// 重置
			cleans1() {
				this.platform = 'all'
				this.phone = ''
				this.isTuan = -1
				this.isRelation = 1
				this.nickName = ''
				this.dataSelect()
			},
			// 重置
			cleans4() {
				this.platform = 'all'
				this.phone = ''
				this.isTuan = -1
				this.isRelation = 0
				this.nickName = ''
				this.dataSelect()
			},
			// 重置
			cleans5() {
				this.platform = 'all'
				this.phone = ''
				this.isTuan = 1
				this.isRelation = -1
				this.nickName = ''
				this.dataSelect()
			},
			cleans2() {
				this.phone = ''
				this.relationId = ''
				this.nickName = ''
				this.memberIds = ''
				this.userSelect()
			},
			cleans3() {
				this.phone = ''
				this.memberIds = ''
				this.page = 1
				this.looseSelect()
			},
			//删除用户
			deleteuser(row) {
				let delid = row.id
				this.$confirm(`确定删除此条信息?`, '提示', {
					confirmButtonText: '确定',
					cancelButtonText: '取消',
					type: 'warning'
				}).then(() => {
					this.$http({
						url: this.$http.adornUrl2(`/user/deleteByUserId/?userId=${delid}`),
						method: 'post',
						params: this.$http.adornData({})
					}).then(({
						data
					}) => {
						this.$message({
							message: '删除成功',
							type: 'success',
							duration: 1500,
							onClose: () => {
								this.name = ''
								this.dataSelect()
							}
						})
					})
				}).catch(() => {})
			},
			// 获取数据列表
			dataSelect() {
				let phone = -1
				if (this.phone) {
					phone = this.phone
				}
				this.tableDataLoading = true
				this.$http({
					url: this.$http.adornUrl2(`/user/userList/${this.page - 1}/${this.size}`),
					method: 'get',
					params: this.$http.adornParams({
						'phone': phone,
						'platform': this.platform,
						'isRelation': this.isRelation,
						'isTuan': this.isTuan,
						'nickName': this.nickName,
						'gradeIndex': this.memberIds
					})
				}).then(({
					data
				}) => {
					this.tableDataLoading = false
					let returnData = data.data
					this.tableData = returnData
				})
			},
			valueSelect() {
				this.$http({
					url: this.$http.adornUrl2('/common/type/91'),
					method: 'get',
					params: this.$http.adornParams({})
				}).then(({
					data
				}) => {
					let returnData = data.data
					this.value = returnData.value
				})
			},
			userSelect() {
				let phone = -1
				if (this.phone) {
					phone = this.phone
				}
				let nickName = -1
				if (this.nickName) {
					nickName = this.nickName
				}
				let relationId = -1
				if (this.relationId) {
					relationId = this.relationId
				}
				this.tableDataLoading = true
				this.$http({
					url: this.$http.adornUrl2(
						`/order/orderList?page=${this.page - 1}&size=${this.size}&phone=${phone}&nickName=${nickName}&relationId=${relationId}`
					),
					method: 'get',
					params: this.$http.adornParams({
						'gradeIndex': this.memberIds
					})
				}).then(({
					data
				}) => {
					this.tableDataLoading = false
					let returnData = data.data
					this.userData = returnData
				})

			},
			// 零钱/积分用户
			looseSelect() {
				let page = this.page - 1
				this.tableDataLoading = true
				this.$http({
					url: this.$http.adornUrl2('/user/getUserList'),
					method: 'get',
					params: this.$http.adornParams({
						'page': page,
						'size': this.size,
						'type': this.type,
						'phone': this.phone,
						'gradeIndex': this.memberIds
					})
				}).then(({
					data
				}) => {
					this.tableDataLoading = false
					let returnData = data.data
					this.looseData = returnData
				})
			},
			// 联系用户
			chatBtn(row) {
				this.$http({
					url: this.$http.adornUrl2('/chat/save'),
					method: 'post',
					data: this.$http.adornData({
						'storeHead': '灵系生活',
						'storeId': 0,
						'storeName': '',
						'userHead': row.image_url,
						'userId': row.userId,
						'userName': row.nickName
					})
				}).then(({
					data
				}) => {
					if (data.status == 0) {
						this.$router.push({
							path: '/vueMchat',

						})
					} else {
						this.$message({
							message: data.msg,
							type: 'warning',
							duration: 1500,
							onClose: () => {}
						})
					}
				})
			},
			// 获取会员等级列表
			configSelect() {
				this.$http({
					url: this.$http.adornUrl2('/member/selectMemberList'),
					method: 'get',
					params: this.$http.adornParams({})
				}).then(({
					data
				}) => {
					let returnData = data.data


					this.memberList = returnData
					for (var i in this.memberList) {
						this.memberList[i].gradeText = this.memberList[i].grade + '级'
					}
				})
			},
			// 一键同步等级
			tongbu() {
				this.$confirm(`确定一键同步用户的等级吗?`, '提示', {
					confirmButtonText: '确定',
					cancelButtonText: '取消',
					type: 'warning'
				}).then(() => {
					this.$http({
						url: this.$http.adornUrl2(`/user/sysnUserGradeIndex`),
						method: 'get',
						params: this.$http.adornData({})
					}).then(({
						data
					}) => {
						if (data.status == 0) {
							this.$message({
								message: '操作成功',
								type: 'success',
								duration: 1500,
								onClose: () => {
									this.dataSelect()
								}
							})
						} else {
							this.$message({
								message: data.msg,
								type: 'warning',
								duration: 1500,
								onClose: () => {}
							})
						}

					})
				}).catch(() => {})
			},
		},
		mounted() {
			this.dataSelect()
			this.valueSelect()
			this.configSelect()
		}
	}
</script>

<style scoped>
	.el-button+.el-button {
		margin-left: 0 !important;
		margin-top: 5px !important;
	}
</style>
